home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / program / 152 / tedinfo.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-06-21  |  1.5 KB  |  49 lines

  1. #include <aesbind.h>
  2. #include <obdefs.h>
  3. #include <gemdefs.h>
  4. #define SPEC 0x510f1L
  5. #define B1FLAGS  0x5
  6. #define B2FLAGS  0x7
  7.  
  8. char input[] = "@@@@@@@@@@@@@@@@";
  9. char template[] = "Your Name:________________";
  10. char check[] = "FFFFFFFFFFFFFFFF";
  11. char button1[] = "Ok";
  12. char button2[] = "GEM";
  13.  
  14. TEDINFO text[] = {
  15.  input, template, check, IBM, 1, TE_CNTR, WHITE, 5, 1, 11, 22
  16. };
  17.  
  18. OBJECT dialogue[] = {
  19.   -1,  1,  3,    G_BOX,    NONE,  NORMAL,    SPEC,   0,  0,600,250,
  20.    2, -1, -1,  G_FTEXT,EDITABLE,  NORMAL,    text, 100, 50,400,100,
  21.    3, -1, -1, G_BUTTON, B1FLAGS,  NORMAL, button1, 230,200, 40, 20,
  22.    0, -1, -1, G_BUTTON, B2FLAGS,  NORMAL, button2, 300,200, 40, 20
  23. };
  24.  
  25. Rect tempbox  = { 0, 0, 0, 0 };
  26. Prect tempptr = { &tempbox.x, &tempbox.y, &tempbox.w, &tempbox.h };
  27.  
  28. main() {
  29.         int nowhere = 0;
  30.         int quit;
  31.         char newstring[29] = "Your name is ";
  32.         appl_init();
  33.         graf_mouse(ARROW, &nowhere);
  34.         form_center(dialogue, tempptr);
  35.         objc_draw(dialogue, ROOT, MAX_DEPTH, tempbox);
  36.         for(;;) {
  37.                 quit = form_do(dialogue, 1);
  38.                 if (quit == 2) {
  39.                         strcat(newstring, input);
  40.                         strcpy(template, newstring);
  41.                         objc_draw(dialogue, ROOT, MAX_DEPTH, tempbox);
  42.                 }
  43.                 if (quit == 3 ) {
  44.                         appl_exit();
  45.                         exit(0);
  46.                 }
  47.         }
  48. }/* MWC pp. 361-362 6Jun'87 CJPurcell                                   */
  49.